<?php

set_include_path('../');

require_once('sixteen/form.php');
require_once('sixteen/dom/elements/label.php');
require_once('sixteen/dom/elements/textbox.php');
require_once('sixteen/dom/elements/checkbox.php');
require_once('sixteen/dom/elements/button.php');

$form = new sixteen::form();

$el1 = new sixteen::dom::elements::textbox();
$el2 = new sixteen::dom::elements::button();
$el3 = new sixteen::dom::elements::checkbox();

$form->addChild($el1);
$form->addChild($el3);
$form->addChild($el2);

$form->setAttribute('name', 'sixteen-form-example');
$form->setAttribute('method', 'POST');
$form->setAttribute('action', '?posted=true');

$el1->addClass('test');
$el1->addClass('x-class');
$el1->setAttribute('id', 'input-fullname');
$el1->setAttribute('name', 'fullname');
$el1->setLabel('Fullname:');
$el1->setValidation('required');
$el1->setValidation('min', 5);
$el1->setValidation('max', 10);
$el1->setValidation('email');

$el2->setAttribute('type', 'submit');
$el2->setAttribute('name', 'submit-me');
$el2->setAttribute('value', 'submit');

$el3->setAttribute('id', 'check-accept');
$el3->setAttribute('checked', 'checked');
$el3->setAttribute('name', 'check-accept');
$el3->setAttribute('value', 'i-am-checked');
$el3->setLabel('Accept?');

echo $form->submit();
?>